Skip to content

fix(afc): make walk tolerant to untraversable directories - #292

Merged
harsha509 merged 1 commit into
appium:mainfrom
navin772:afc-tolerant-walk
Aug 12, 2026
Merged

fix(afc): make walk tolerant to untraversable directories#292
harsha509 merged 1 commit into
appium:mainfrom
navin772:afc-tolerant-walk

Conversation

@navin772

Copy link
Copy Markdown
Member

Currently, the afc test suite errors out on the walk() method as some dirs throw permission denied error which errors out the whole process instead of just skipping and continuing with other valid dirs.

This change wraps the listdir call so an unreadable directory is skipped and logged at debug level, rather than killing the traversal.

Error:

 npm run test:afc

  > appium-ios-remotexpc@5.14.3 test:afc
  > node --enable-source-maps --test --test-timeout=60000 "build/test/integration/afc.spec.js"

  ▶ AFC Service
    ✔ should list root directory and contain standard folders (133.59775ms)
    ✔ should write, read, rename and delete a file in Downloads (589.9565ms)
    ✔ should read and write files using streams (457.315375ms)
    ✔ should push and pull files between local and device (511.1235ms)
    ✖ should walk directories and include expected entries (10863.679292ms)
    ✔ should recursively pull directory with files (1755.675833ms)
    ✔ should respect overwrite option when pulling files (2186.041083ms)
    ✔ should not create empty directories when pulling with match pattern (2258.3675ms)
  ✖ AFC Service (18771.606667ms)
  ℹ tests 8
  ℹ suites 1
  ℹ pass 7
  ℹ fail 1
  ℹ cancelled 0
  ℹ skipped 0
  ℹ todo 0
  ℹ duration_ms 19277.089709

  ✖ failing tests:

  test at test/integration/afc.spec.ts:128:3
  ✖ should walk directories and include expected entries (10863.679292ms)
    Error: AFC operation READ_DIR failed with PERM_DENIED (10)
        at AfcService._doOperation (/Users/navinchandra/Documents/Projects/remote_xpc_project/appium-ios-remotexpc/src/services/ios/afc/index.ts:803:13)
        at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
        at async AfcService.listdir (/Users/navinchandra/Documents/Projects/remote_xpc_project/appium-ios-remotexpc/src/services/ios/afc/index.ts:125:18)
        at async AfcService.walk (/Users/navinchandra/Documents/Projects/remote_xpc_project/appium-ios-remotexpc/src/services/ios/afc/index.ts:484:21)
        at async AfcService.walk (/Users/navinchandra/Documents/Projects/remote_xpc_project/appium-ios-remotexpc/src/services/ios/afc/index.ts:497:20)
        at async AfcService.walk (/Users/navinchandra/Documents/Projects/remote_xpc_project/appium-ios-remotexpc/src/services/ios/afc/index.ts:497:20)
        at async TestContext.<anonymous> (/Users/navinchandra/Documents/Projects/remote_xpc_project/appium-ios-remotexpc/test/integration/afc.spec.ts:130:22)
        at async Test.run (node:internal/test_runner/test:980:9)
        at async Suite.processPendingSubtests (node:internal/test_runner/test:677:7)

@harsha509
harsha509 merged commit ac6959b into appium:main Aug 12, 2026
9 checks passed
@navin772
navin772 deleted the afc-tolerant-walk branch August 12, 2026 15:20
github-actions Bot pushed a commit that referenced this pull request Aug 12, 2026
## [5.14.4](v5.14.3...v5.14.4) (2026-08-12)

### Bug Fixes

* **afc:** make walk tolerant to untraversable directories ([#292](#292)) ([ac6959b](ac6959b))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 5.14.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants